/*
 * @Description: 首页js
 * @Author: zhangchenna
 * @Date: 2019-02-25 17:06:37
 * @LastEditTime: 2019-04-20 21:14:23
 */
import '../../style/index/index.scss';
import '../../utils/header';
import Swiper from 'swiper';
import Layer from '../../components/layer/layer';

let caseSwiper = new Swiper('.index-case-swiper', {
    speed: 3000,
    spaceBetween: 80,
    slidesPerView: 3,
    autoplay: {
        delay: 3000
    },
    pagination: {
        el: '.swiper-pagination'
    },
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev'
    }
});

caseSwiper;

let jumpLayer = function() {
    let html = document.querySelector('.index-video-layer-content').innerHTML;
    Layer.fn('index-video-layer', html, 'index-video-layer-box');
};

document.querySelectorAll('.jump-video').forEach(item => {
    item.addEventListener('click', jumpLayer, false);
});
